<template>
  <el-form :model="ruleForm" label-position="top" :class="isEdit?'':'formItem'">
    <!--用印文件-->
    <el-card class="box-card" shadow="never">
      <div slot="header" class="header-card">
        <span class="header-card-title">用印文件</span>
      </div>
      <el-row :gutter="24">
        <el-form-item label="上传用印文件:" v-if="isShow" prop="useSealsOss">
          <image-common v-model="ruleForm.useSealsOss" :limit="20" :disabled="!isEdit"  :upType="2"  />
        </el-form-item>
      </el-row>
    </el-card>
  </el-form>
</template>

<script>
export default {
  name: 'printedDocument',//用印文件
  model: {
    prop: 'detailForm',
    event: 'update:detailForm',
  },

  props: {
    detailForm: {
      type: Object,
      default: {},
    },
    state: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
      isShow: true,
    };
  },
  computed: {
    ruleForm: {
      get() {
        let that = this
        const proxy = new Proxy(that.detailForm, {
          get(target, key) {
            return Reflect.get(target, key)
          },
          set(target, key, value) {
            that.$emit('update:detailForm', {...target, [key]: value})
            return true
          }
        })
        return proxy
      }
    },labelPosition() {
      if (this.isEdit) {
        return "top";
      } else {
        return "left";
      }
    },
    isEdit() {
      let bool;
      switch (this.state) {
        case "write":
          bool = true;
          break;
        case "disabled":
          bool = false;
          break;
        case "readonly":
          bool = false;
          break;
      }
      return bool;
    },
  },
  watch: {},
  created() {
  },
  mounted() {
  },
  methods: {

  },
};
</script>

<style lang="scss" scoped>
@import "@/styles/cwgd/formScss.scss";
</style>


